extends Weapon



# 回旋镖回到手中后，才能进行下次攻击
var _can_next_attack: bool = true


func _ready() -> void:
    super._ready()


func _create_attack_effect() -> Bullet:
    var bullet := super._create_attack_effect()

    if not bullet.is_connected(bullet.expired.get_name(), _on_bullet_expired):
        bullet.expired.connect(_on_bullet_expired)
    
    sprite.hide()
    return bullet


func attack() -> void:
    if not _can_next_attack: return
    super.attack()
    _can_next_attack = false


func _on_bullet_expired() -> void:
    _can_next_attack = true
    sprite.show()